<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>mymsgro</title>
	<link rel="stylesheet" type="text/css" href="css/main.css" />
	<link rel="stylesheet" type="text/css" href="css/meniu.css" />
	<link rel="stylesheet" type="text/css" href="css/style.css" />
</h:head>

<h:body>

	<ui:include src="header.xhtml" />

	<h:panelGroup layout="block" id="content">

		<ui:include src="leftMenu.xhtml" />

		<h:panelGroup layout="block" id="contenRight">
<f:event type="preRenderView" listener="#{candidateBean.preRenderView}"/>
			<h:panelGroup layout="block" id="header" style="margin-top: 20px;">
				<ul>
					<li id="selected"><a>Interviews</a></li>
				</ul>
			</h:panelGroup>

			<h:panelGroup layout="block" id="contentTab">
				<h:form>
					<h:commandButton style="width:50px; height:30px;"
						image="resources/img/back-button.png"
						action="#{interviewBean.goBack}" immediate="true"></h:commandButton>

					<h:panelGroup rendered="#{interviewBean.deletion == true}"
						layout="block">
						<h:outputText value="Confirm deletion" style="color:red">
						</h:outputText>
						<h:commandButton value="Yes"
							action="#{interviewBean.deleteInterview}"></h:commandButton>
						<h:commandButton value="No" action="#{interviewBean.init}"></h:commandButton>
					</h:panelGroup>

					<p:dataTable value="#{interviewBean.interviews}" var="interview"
						paginator="true" rows="10"
						paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
						rowsPerPageTemplate="3,6,10">


						<p:column sortBy="#{interview.date}">
							<f:facet name="header">
								<h:outputText value="Date" />
							</f:facet>
							<h:inputText value="#{interview.date}">
								<f:convertDateTime type="date" pattern="yyyy-MM-dd" />
							</h:inputText>
						</p:column>

						<p:column>
							<f:facet name="header">
								<h:outputText value="Details" />
							</f:facet>
							<h:inputTextarea value="#{interview.details}" cols="20" rows="2" readonly="true" style="border-color:transparent;background:transparent"/>

						</p:column>

				
						<p:column>
							<f:facet name="header">
								<h:outputText value="Delete" />
							</f:facet>
							<h:commandButton value="Delete and send email"
								action="#{interviewBean.delete(interview.id)}" styleClass="buttonCandidate" />
						</p:column>


					</p:dataTable>




					<h:outputText value="#{interviewBean.errorMessageDelete}"
						style="color:red" />
				</h:form>

			</h:panelGroup>
		</h:panelGroup>
	</h:panelGroup>
</h:body>
</html>